package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties("handler")
public class ViewPoint extends BaseDomain{

    private String name;//景点名

    private Region place;//景点地区

    private String address;//景点地址

    private String coverUrl;//景点封面

    private String content;//景点内容

    List<Ticket> tickets;//门票信息

    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("coverUrl", coverUrl);
        map.put("address", address);
        map.put("content", content);
        if (place != null) {
            map.put("place", place);
        }
        return JSONUtil.toJSONString(map);
    }

}